from app import create_app
import sys

application = create_app(flask_config = 'testing')
from app.modules.user.resources import addRoleForUser
from app.modules.user.models import User

reload(sys)
sys.setdefaultencoding('utf8')


def addRole():
    with application.app_context():
        _list = User.query.all()
        for _user in _list:
            addRoleForUser(_user.id, 'pd')
            print _user

addRole()